#include "Defs.h"
#include "Config.h"
#include "Filter.h"
#include "Extension.h"


Config_T * g_configPtr = 0;
HINSTANCE g_hInstance;


BOOL WINAPI DllMain
(
	HINSTANCE hInstance, 
	DWORD dwReason, 
	void * // pContext_T OPTIONAL
)
{
	g_hInstance = hInstance;

	if( dwReason == DLL_PROCESS_ATTACH )
		DisableThreadLibraryCalls(hInstance);

	return TRUE;
}


BOOL WINAPI GetFilterVersion
(
	HTTP_FILTER_VERSION *pVer
)
{
	return OnGetFilterVersion(pVer);
}


DWORD WINAPI HttpFilterProc
(
	PHTTP_FILTER_CONTEXT pFC, 
	DWORD dwNotifyType, 
	void * pvNotify
)
{
	return OnHttpFilterProc(pFC, dwNotifyType, pvNotify, g_configPtr);
}


BOOL WINAPI TerminateFilter
(
	DWORD dwFlags
)
{
	return OnTerminateFilter(dwFlags);
}


BOOL WINAPI GetExtensionVersion
(
	HSE_VERSION_INFO* pVer
)
{
    return OnGetExtensionVersion(pVer);
}


DWORD WINAPI HttpExtensionProc
(
	EXTENSION_CONTROL_BLOCK* pECB
)
{
    return OnHttpExtensionProc(pECB);
}
